<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    templates/index.html zhu hui SpringMVC
    <!--字符串输出-->
    <p th:text="'hello SpringBoot'">hello thymeleaf</p>
    <!--数学运算-->
    <p th:text="9 + 10"></p>
    <p th:text="10 * 10"></p>
    <p th:text="1 - 10"></p>
    <p th:text="8 / 3"></p>
    <p th:text="3 % 2"></p>
    <!--操作域对象-->
    <p th:text="${user}"></p>
    <p th:text="${user.userName}"></p>


    <!--设置属性-->
    <input type="text" th:attr="value=${user.userName}">
    <input type="text" th:attr="value=${user.userName}, title=${user.userName}">

    <!--表单数据绑定-->
    <form action="" th:object="${user}">
        <input type="text" th:value="*{userName}">
        <input type="userPwd" th:value="*{userPwd}">
    </form>

    <!--解析html文本内容-->
    <p th:utext="'<span>html</span>'"></p>

    <!--流程控制-->
    <p th:if="${user.userName} != ${user.userPwd}">yes</p>
    <div th:switch="${user.userName}">
        <p th:case="rose">name is rose</p>
        <p th:case="jack">name is jack</p>
    </div>

    <!--外部引入-->
    <link rel="stylesheet" th:href="@{/static/css/index.css}">
    <script th:src="@{/static/js/index.js}"></script>

    <a th:href="@{/}">home</a>
</body>

</html>